<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <h1>绑定style属性</h1>
    <ul>
        <li>方法一：直接绑定对象，对象的属性为style属性名，值为style属性值。</li>
        <li>方法二：绑定数组，数组中的元素是方法一种的对象。最终会将对象中的属性进行合并。</li>
    </ul>
    <main id="app">
        <p :style="styleColor">我是p标签</p>
        <p :style="[styleColor,styleBorder]">我是p标签</p>
    </main>
</body>
<script src="../vue.min.js"></script>
<script>
    let vue = new Vue({
        el: "#app",
        data() {
            return {
                styleColor: {
                    color: "#f00",
                    backgroundColor: "#0f0",
                },
                styleBorder: {
                    border: "1px solid #f00",
                    borderRadius: "15px"
                }
            }
        },
    });
</script>
</html>